package tvv.levelup.addressDAO.model;

/**
 * Created by VLAD on 12.05.14.
 */
import java.util.ArrayList;
import java.util.List;

public class Address
{
    private int id;
    private String country;
    private String city;
    private String street;
    private String houseNumber;
    private List<String> numbers;
    private static int addressCounter = 0;

    public Address()
    {

    }

    public Address(int id, String country, String city, String street, String houseNumber)
    {
        this.id = id;
        this.country = country;
        this.city = city;
        this.street = street;
        this.houseNumber = houseNumber;

    }

    public Address(int id, String country, String city, String street, String houseNumber, List<String> numbers) {
        this.id = id;
        this.country = country;
        this.city = city;
        this.street = street;
        this.houseNumber = houseNumber;
        this.numbers = numbers;

    }
    public void addNumber(String number)
    {
        if(this.numbers != null)
        {
            this.numbers.add(number);
        }
        else
        {
            numbers = new ArrayList<>();
            numbers.add(number);
        }
    }
    public void addNumbers(List numbers)
    {
        if(this.numbers != null)
        {
            this.numbers.addAll(numbers);
        }
        else
        {
            this.numbers = numbers;
        }
    }

    public int getAddressCounter()
    {
        return addressCounter;
    }

    public int getId() {
        return id;
    }

    public String getCountry() {
        return country;
    }

    public String getCity() {
        return city;
    }

    public String getStreet() {
        return street;
    }

    public String getHouseNumber() {
        return houseNumber;
    }

    public List<String> getNumbers() {
        return numbers;
    }

    public void setAddressCounter(int addressCounter)
    {
        this.addressCounter = addressCounter;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public void setHouseNumber(String houseNumber) {
        this.houseNumber = houseNumber;
    }

    public void setNumbers(List<String> numbers) {
        this.numbers = numbers;
    }

    @Override
    public String toString() {
        return "Address{" + "id=" + id + ", country=" + country + ", city=" + city + ", street=" + street + ", houseNumber=" + houseNumber + ", numbers=" + numbers + '}';
    }
}
